package simplebinding;

import simplebinding.guice.BinderModule;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Module;

public class Main {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//Pass the default module to the injector
		Injector defaultInjector = Guice.createInjector();
		//Create a new client object
		Client defaultClient = defaultInjector.getInstance(Client.class);
		//Run the client
		defaultClient.run();

		System.out.println("\n\n");

		//Create a new binder module
		Module binderModule = new BinderModule();
		//Pass the module to the injector
		Injector binderInjector = Guice.createInjector(binderModule);
		//Create a new client
		Client client = binderInjector.getInstance(Client.class);
		//Run the client
		client.run();
	}

}
